package com.ouc.oceanBase.service;


import com.beust.jcommander.internal.Nullable;
import com.ouc.oceanBase.entity.ContourData;
import com.ouc.oceanBase.entity.FlowGridData;
import ucar.ma2.InvalidRangeException;
import ucar.nc2.NetcdfFile;

import java.io.IOException;

public interface EddyCharacterService {

  /**
   * 获取流速等值线格网数据
   *
   * @param ncFile nc文件
   * @return
   */
  ContourData<FlowGridData> getFlowGridData(NetcdfFile ncFile, Integer level) throws IOException, InvalidRangeException;

  /**
   * 获取流速等值线格网数据
   *
   * @param ncFile    nc文件
   * @param level     层级
   * @param longitude 经度限制
   * @param latitude  纬度限制
   * @return
   * @throws IOException
   * @throws InvalidRangeException
   */
  ContourData<FlowGridData> getFlowGridData(NetcdfFile ncFile, @Nullable Float[] longitude, @Nullable Float[] latitude, Integer level, Integer time) throws IOException, InvalidRangeException;

  /**
   * 获取风场等值线格网数据
   *
   * @param fileName  文件地址
   * @param longitude 经度
   * @param latitude  纬度
   * @param level     层级
   * @param time      时间
   * @return
   * @throws IOException
   * @throws InvalidRangeException
   */
  ContourData<FlowGridData> getFlowGridDataWithWind(String fileName, @Nullable Float[] longitude, @Nullable Float[] latitude, Integer level, Integer time) throws IOException, InvalidRangeException;

  /**
   * 对于u和v有两个文件要分别获取数据
   *
   * @param filePath  文件路径
   * @param longitude 经度限制
   * @param latitude  纬度限制
   * @param level     层级
   * @param time      时间
   * @return
   * @throws IOException
   * @throws InvalidRangeException
   */
  ContourData<FlowGridData> getFlowGridDataFormTwoFile(String filePath, @Nullable Float[] longitude, @Nullable Float[] latitude, Integer level, Integer time, Integer index) throws IOException, InvalidRangeException;

  /**
   * 获取流速数据
   *
   * @param ncFile    nc文件
   * @param longitude 经度限制
   * @param latitude  纬度限制
   * @param level     层级
   * @return
   * @throws IOException
   * @throws InvalidRangeException
   */
  ContourData<FlowGridData> getFlowGridData(NetcdfFile ncFile, @Nullable Float[] longitude, @Nullable Float[] latitude, Integer level) throws IOException, InvalidRangeException;


  /**
   * 获取流速等值线格网数据
   * 适用于有一个总值和一个角度的数据
   * 计算cos和sin
   *
   * @param ncFile    nc文件
   * @param longitude 经度
   * @param latitude  纬度
   * @param level     层级
   * @return
   * @throws IOException
   * @throws InvalidRangeException
   */
  ContourData<FlowGridData> getFlowGridDataFromDegree(NetcdfFile ncFile, @Nullable Float[] longitude, @Nullable Float[] latitude, Integer level) throws IOException, InvalidRangeException;

  /**
   * 获取带有角度和大小的流
   *
   * @param ncFile    nc文件
   * @param longitude 经度
   * @param latitude  纬度
   * @param level     层级
   * @param time      时间
   * @return
   * @throws IOException
   * @throws InvalidRangeException
   */
  ContourData<FlowGridData> getFlowGridDataFromDegree(NetcdfFile ncFile, @Nullable Float[] longitude, @Nullable Float[] latitude, Integer level, Integer time) throws IOException, InvalidRangeException;


}
